package com.tjetc.hw;

import java.util.Scanner;

public class 字符串编码 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        StringBuilder encoded = new StringBuilder();
        char[]c=s.toCharArray();
        int count = 1;
        char ch = c[0];
        for (int i = 1; i < c.length; i++){
            if (c[i]>='a'&&c[i]<='z'){
                if (c[i]==ch){
                    count++;
                }else {
                    encoded.append(ch).append(count);
                    ch = c[i];
                    count=1;
                }
            }
        }
        encoded.append(ch).append(count);
        System.out.println(encoded);
    }


}
